package com.nx.samuel.dubbo_vip_loadbalance_demo.provider.impl;

import com.nx.samuel.dubbo_vip_loadbalance_demo.api.HelloService;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.rpc.RpcContext;


public class HelloServiceImpl implements HelloService {

    @Override
    public String sayHello(String username) {
        URL url = RpcContext.getContext().getUrl();
        return "hello" + username + String.format("protocol is %s, address is %s ", url.getProtocol(), url.getAddress());
    }
}
